using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Bag : MonoBehaviour
{
    public PlayerController2D player;
    public GameObject bag;
    public int num_1;
    public int num_2;
    public int num_3;
    public Text Text_1;
    public Text Text_2;
    public Text Text_3;

    void Update()
    {
        Text_1.text = num_1.ToString();
        Text_2.text = num_2.ToString();
        Text_3.text = num_3.ToString();
        if (Input.GetKeyDown(KeyCode.Tab))
        {
            bag.SetActive(!bag.activeSelf);
        }
    }
    public void Use_1()
    {
        if(num_1 >= 5)
        {
            num_1 -= 5;
            player.life++;
        }
    }
    public void Use_2()
    {
        if (num_2 >= 1)
        {
            num_2--;
            player.damage++;
        }
    }
    public void Use_3()
    {
        if(num_3 >= 1)
        {
            num_3--;
            player.life++;
        }
    }
}
